package com.changgou.search.listener;

import com.changgou.search.config.RabbitMqConfig;
import com.changgou.search.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GoodsDownListener {

    @Autowired
    private ESManagerService esManagerService;

    @RabbitListener(queues = RabbitMqConfig.SEARCH_DEL_QUEUE)
    public void receiveMessage(String spuId){
        System.out.println("接收到的队列信息是："+spuId);

        //查询 skuList ，并 从 索引库中 进行删除
        esManagerService.deleteDataBySpuId(spuId);

    }
}
